import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 用户授权维护信息 */
export interface UserAuth {
          id: number; // ID
          userId?: number; // 用户ID
          deptId?: number; // 部门ID
          name?: string; // 姓名
          idCard?: string; // 身份证
          mobile?: string; // 手机号
          status?: number; // 状态（0未完成 1已完成）
          remark: string; // 备注
  }

// 用户授权维护 API
export const UserAuthApi = {
  // 查询用户授权维护分页
  getUserAuthPage: async (params: any) => {
    return await request.get({ url: `/business/user-auth/page`, params })
  },

  // 查询用户授权维护详情
  getUserAuth: async (id: number) => {
    return await request.get({ url: `/business/user-auth/get?id=` + id })
  },

  // 新增用户授权维护
  createUserAuth: async (data: UserAuth) => {
    return await request.post({ url: `/business/user-auth/create`, data })
  },

  // 修改用户授权维护
  updateUserAuth: async (data: UserAuth) => {
    return await request.put({ url: `/business/user-auth/update`, data })
  },

  // 删除用户授权维护
  deleteUserAuth: async (id: number) => {
    return await request.delete({ url: `/business/user-auth/delete?id=` + id })
  },

  /** 批量删除用户授权维护 */
  deleteUserAuthList: async (ids: number[]) => {
    return await request.delete({ url: `/business/user-auth/delete-list?ids=${ids.join(',')}` })
  },

  // 导出用户授权维护 Excel
  exportUserAuth: async (params) => {
    return await request.download({ url: `/business/user-auth/export-excel`, params })
  },
}